<?php

namespace app\validate;

use share\validate\SceneValidate;

class CountryCodeValidate extends SceneValidate{
    protected $rule = [
        'isocode' => 'require|length:2,4',
        'phoneCode' => 'require|integer',
        'location' => 'require|length:2,120',
        'locationName' => 'require|length:1,200',
    ];  
    protected $sceneRules = [
        'edit' => [
            'isocode' => 'length:2,4',
            'phoneCode' => 'integer',
            'location' => 'length:2,120',
            'locationName' => 'length:1,200',    
        ],
        'list' => [
            'isocode' => 'length:2,4',
            'phoneCode' => 'integer',
            'locationName' => 'length:1,200',    
            'location' => 'length:2,120',
        ],
    ];

    protected $scene = [        
        'add' => ['isocode','phoneCode','location','locationName'],
        'edit' => ['isocode','phoneCode','location','locationName'],
        'del' => ['isocode'],
        'list' => ['isocode','phoneCode','location','locationName'],
    ];
}